package com.aplink.generic.constant.type;

import android.widget.ListView;

public enum ListViewSelection {

	MULTIPLE_SELECTION(ListView.CHOICE_MODE_MULTIPLE, "MULTIPLE_SELECTION"),
	NONE(ListView.CHOICE_MODE_NONE, "NONE"),
	SINGLE_SELECTION(ListView.CHOICE_MODE_SINGLE, "SINGLE_SELECTION");

	public static ListViewSelection get(final String type) {
		for (final ListViewSelection listViewSelection : ListViewSelection
				.values()) {
			if (listViewSelection.mName.equalsIgnoreCase(type)) {
				return listViewSelection;
			}
		}
		return NONE;
	}

	private String mName;

	private int mValue;

	private ListViewSelection(final int value, final String name) {
		this.mValue = value;
		this.mName = name;
	}

	public int getValue() {
		return this.mValue;
	}

	public void setValue(final int value) {
		this.mValue = value;
	}
}
